package cn.ujn.medicalbackend.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName sysregion
 */
@TableName(value ="sysregion")
@Data
public class Sysregion implements Serializable {
    /**
     * 区域主键
     */
    @TableId(value = "id")
    private Integer id;

    /**
     * 区域编码
     */
    @TableField(value = "name")
    private String name;

    /**
     * 区域上级标识
     */
    @TableField(value = "parent_id")
    private Integer parentId;

    /**
     * 地名简称
     */
    @TableField(value = "SimpleName")
    private String simplename;

    /**
     * 区域等级
     */
    @TableField(value = "Level")
    private Integer level;

    /**
     * 城市编码
     */
    @TableField(value = "CityCode")
    private String citycode;

    /**
     * 邮政编码
     */
    @TableField(value = "ZipCode")
    private String zipcode;

    /**
     * 组合名称
     */
    @TableField(value = "MerName")
    private String mername;

    /**
     * 经度
     */
    @TableField(value = "Lng")
    private Double lng;

    /**
     * 纬度
     */
    @TableField(value = "Lat")
    private Double lat;

    /**
     * 拼音
     */
    @TableField(value = "PinYin")
    private String pinyin;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Sysregion other = (Sysregion) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
            && (this.getSimplename() == null ? other.getSimplename() == null : this.getSimplename().equals(other.getSimplename()))
            && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
            && (this.getCitycode() == null ? other.getCitycode() == null : this.getCitycode().equals(other.getCitycode()))
            && (this.getZipcode() == null ? other.getZipcode() == null : this.getZipcode().equals(other.getZipcode()))
            && (this.getMername() == null ? other.getMername() == null : this.getMername().equals(other.getMername()))
            && (this.getLng() == null ? other.getLng() == null : this.getLng().equals(other.getLng()))
            && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
            && (this.getPinyin() == null ? other.getPinyin() == null : this.getPinyin().equals(other.getPinyin()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getSimplename() == null) ? 0 : getSimplename().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getCitycode() == null) ? 0 : getCitycode().hashCode());
        result = prime * result + ((getZipcode() == null) ? 0 : getZipcode().hashCode());
        result = prime * result + ((getMername() == null) ? 0 : getMername().hashCode());
        result = prime * result + ((getLng() == null) ? 0 : getLng().hashCode());
        result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
        result = prime * result + ((getPinyin() == null) ? 0 : getPinyin().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", parentId=").append(parentId);
        sb.append(", simplename=").append(simplename);
        sb.append(", level=").append(level);
        sb.append(", citycode=").append(citycode);
        sb.append(", zipcode=").append(zipcode);
        sb.append(", mername=").append(mername);
        sb.append(", lng=").append(lng);
        sb.append(", lat=").append(lat);
        sb.append(", pinyin=").append(pinyin);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}